chcp 65001
cls
@echo.
@echo.
@echo                         ------开启代理 by:@zehua------
@echo.
@echo.
@echo.
@echo.

:_startproxy
    @echo off
	set "addr=192.168.8.195"
    set "port=7890"
	set "operation=0"
	set /p operation=请输入你要的操作[0:配置代理 1：关闭代理  输入q 退出] 默认%operation%:
	if "%operation%"=="1" goto _stopproxy  
	if "%operation%"=="q" goto end   
    set /p addr=请输入代理的地址[输入q 退出] 默认%addr%:
	if "%addr%"=="q" goto end   
    set /p port=请输入远端代理的ip[输入q 退出]  默认%port%:
    if "%port%"=="q" goto end
	echo 开始设置IE代理上网 
	reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f 
	reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "%addr%:%port%" /f 
	reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "127.0.0.1;192.168.8.*" /f
	echo 代理地址 %addr% 代理端口 %port% 完成配置
	timeout /t 5
	goto end
:_stopproxy
    @echo off
	echo 开始清除IE代理设置 
	reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f 
	reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f 
	echo "完成清理"
	goto _startproxy

pause
:end
cls


echo 操作完成按任意键关闭 
pause>nul